package com.base.component.aws.s3.cloudfront;

import java.io.File;

import com.gitee.magic.framework.head.utils.IoUtils;

public class SingerTest {

	public static void main(String[] args) {
		String privateKeyString=new String(IoUtils.getFileBytes(new File("/Users/mac/Desktop/cloudfront-private-key.pem")));
		privateKeyString=privateKeyString.replace("-----BEGIN RSA PRIVATE KEY-----", "");
		privateKeyString=privateKeyString.replace("\n", "");
		privateKeyString=privateKeyString.replace("-----END RSA PRIVATE KEY-----","");
		System.out.println(privateKeyString);
		
		String resourceUrl = "https://aimate-pn-private.banyuewan.cn/aimate/video/chat/6248aa35d0069932e163c1011f93a9fb.mp4";
		String keyPairId="K1H6EZ3WWXLKPR";
//		String privateKeyString="MIIEpQIBAAKCAQEAsfcVy5PcfrLXc3/JEqTcFcclOyHcwGpluJG0k58Cb0klqnxDzv3EJH8Wm4sqeuLg0CcyFIRgemi/Kgj9XgIjNEm5GwM3ybaWwTB7TiPtrfeY/90vUHLNOGgPjUbGRJQMGaT8Qb7C6CZ6xbM28l7IeinBA8DrTNzUW6Oorry7CxTV47r+ohkSTaaYdEFzASRqbMsksvizSJZfC4ngFdCryewdWYViDgUJybJMephxMX5dwr/iVXnTU339LdvXFGRvtZ+g7Mq5kYgEFU2nX9i0C3LJS88S24FAVzsNfrF6ArDCLi8+mBtHvf/aouEG6fuw2txmlTeqj2MTAuIICTU05QIDAQABAoIBAQCqstJAA2JyUH5htYcbD/BeHzcx4cgI88T/5Rosok9GiQXM4gZ0a2oQi6oWpcSoPCfg4Eej8FlN8Fy0KA1Gd4xm4fPf2hVPsIgnY6ZSDBo1TJF/khuI8aSwXvfTzbftHYgBrQOc2CnBXO9T5BNnJMzsiFIvlILdpc822uK4QCS0eb0RMRJWj61+KbPfbuEw6dEebIVZFgz4nju8HwYZXFARck6yMw+PO5nDwG58kBvIUvEYwOGj4Yh19tJCbMsIiXHNnH2lhEJqC2udatwlkBrBMRWpSONOzmg0I1FLOSxQzPxygXxonmI6BleL6Ccc0V5iStOc73HBLF/Zj+DYi5AhAoGBANuYVPYItNN/6XRu1tI0TGfNAy6EYmtwO6tMArCAV7RiwtHDA3FaCmZGDRCgYeRF/9n30UDIbPtSlWLiScP7I6rx7pu0y5MgszCBgUw98AxQtLW/kbp2tNFjDz+ZtflEJSm0cdU5Jf/GGh486PicwMKkubDKs5Jy0i3pzGF6HB+5AoGBAM93+KUKc55jsd4xo/t7nTc8SbIGzzzy0xdeHpVZdXVRGm4dy9gvfyQPgGz/w1KH8ZCNkn1aCJYtliu47K9zsVBwHWqdgOlq4dPD7MQ7tPlisCMJuxSjGbmUaKQpXZYZuhHYeFWn2BcZ3RZ1y7wp/Con2Cr6QvCcMFL8ZBja+5yNAoGBANRZz7cIHkz0Qb59PLGTL1ulbfE6xa3dn2X7oBIsWiOu6XRM3/RqPOo/zXyJi4BijJKsSaca6gBzENDJwMmK/yfcwn/B6qbBFWbPpUgkERDnroie0v58skhVQbagHtAILOPSgc3OcMeRO0qIXkWj1+ehwYuLyPDSphsOHr0Yhz/JAoGAb0+07gevhLmEguwrSRBHh40nFQcmRVMbApyS2BqJNIpxHceKyNCi7FwM0W5gA3XAm4f5opudo8WNnqO3CWOPLNMaVUtwEMwxoYarD5XhQTQ7wHDGGQpxEOqZQgqXlaLz/AMifQJyo+JShmxpBOmZy5xZFKX1KFcEbmHP6q4C9TkCgYEAsq5ZiYPtpKxUTSRoNtZMBn/6MUS89cdzbuSbTJ+qNYnrH3iQzpBb5E+xnrlyntJZjk9FcvMDmobZEBXRTKekVT6LlhUMLH1JS5XZfzlnq9t/ndrkR7+C/gJO1xLrCk0FYcRzVyB0X67XT5JUZdEm8ofcOgQlU8dz5WTMPnO8nMI=";
		
        String url=SingerUrl.getSignUrl(resourceUrl,keyPairId,privateKeyString);
        System.out.println(url);
	}
	
}
